< previous page page_274 next page >

Page 274
The SELECT_FROM Statement
In this section, you will learn about the most commonly used SQL statement, the SELECT_FROM statement. The SELECT_FROM statement lets you pick records from one or more tables in a database. The results of a SELECT_FROM statement are returned as a view. This view is a subset of the source data. In Visual Basic, the view can be returned as a Recordset, Table, Dynaset, or Snapshot. Because today's lesson focuses on getting results you can display, views will be returned as Visual Basic Snapshot data objects.
In its simplest form, a SELECT_FROM statement contains two parts:
· A list of one or more table columns to select;
· A list of one or more tables that contain the requested columns.
Note.gif
Standard SQL syntax uses the word column to describe a field and row to describe a record. This book uses the term field interchangeably with column and record interchangeably with row.

A simple example of a valid SQL statement is
SELECT AUID FROM Authors
This SQL statement tells the Microsoft Jet database engine to return a data object that contains the AUID from the Authors table. Enter this SQL statement into the Visdata SQL window and click the Execute button to see the returned result set. Your screen should look similar to the one in Figure 8.1.
0274-01.jpg
Figure 8.1.
The result set from the first 
SELECT statement.

 
< previous page page_274 next page >

If you like this book, buy it!